package com.my.fp.list;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author: marshal
 * @date: 2022-01-10 11:39 AM
 */
public class PeekTest {
    public static void main(String[] args) {
        List<String> list = Stream.of("one", "two", "three", "four").filter(e -> e.length() > 3).peek(e -> System.out.println("Filtered value: " + e)).map(String::toUpperCase).peek(e -> System.out.println("Mapped value: " + e)).collect(Collectors.toList());
        System.out.println(list);
    }
}
